package com.anhry.www.safety.manage.oa.bean;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.anhry.www.safety.manage.enterprise.bean.TbCorpInfo;
import com.anhry.www.safety.manage.system.bean.TbUser;

/**
 * 
 * @author chen
 * @date 2012-8-9
 */
@Entity
@Table(name="TB_OA_NOTICE_USER")
@SequenceGenerator(name="TB_OA_NOTICE_USER_SEQ", sequenceName="TB_OA_NOTICE_USER_SEQ_DB", allocationSize=1)
public class TbOaNoticeUser implements java.io.Serializable {

	// Fields

	private Long id;
//	private String noticeId;
//	private String userId;
//	private String corpId;
	private TbOaNotice tbOaNotice;
	private TbUser tbUser;
	private TbCorpInfo tbCorpInfo;
	private String isRead;
	private Date readTime;
	private String userType;
	private String isDele;
	private String version;
	private String isNot;	//短信是否发送0：未发送1：已发送

	// Constructors

	/** default constructor */
	public TbOaNoticeUser() {
	}

	/** full constructor */
	public TbOaNoticeUser(TbOaNotice tbOaNotice, TbUser tbUser, TbCorpInfo tbCorpInfo,
			String isRead, Date readTime, String userType, String isDele,String isNot,
			String version) {
		this.tbOaNotice = tbOaNotice;
		this.tbUser = tbUser;
		this.tbCorpInfo = tbCorpInfo;
		this.isRead = isRead;
		this.readTime = readTime;
		this.userType = userType;
		this.isDele = isDele;
		this.version = version;
		this.isNot = isNot;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="TB_OA_NOTICE_USER_SEQ")
	@Column(name = "ID", precision = 11, scale = 0)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.EAGER)
	@JoinColumn(name="CORP_ID")
	public TbCorpInfo getTbCorpInfo() {
		return tbCorpInfo;
	}

	public void setTbCorpInfo(TbCorpInfo tbCorpInfo) {
		this.tbCorpInfo = tbCorpInfo;
	}
	@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.EAGER)
	@JoinColumn(name="NOTICE_ID")
	public TbOaNotice getTbOaNotice() {
		return tbOaNotice;
	}

	public void setTbOaNotice(TbOaNotice tbOaNotice) {
		this.tbOaNotice = tbOaNotice;
	}
	@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.EAGER)
	@JoinColumn(name="USER_ID")
	public TbUser getTbUser() {
		return tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@Column(name="IS_READ", length=1)
	public String getIsRead() {
		return this.isRead;
	}

	public void setIsRead(String isRead) {
		this.isRead = isRead;
	}

	@Column(name="READ_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getReadTime() {
		return this.readTime;
	}

	public void setReadTime(Date readTime) {
		this.readTime = readTime;
	}
	@Column(name="USER_TYPE",length=1)
	public String getUserType() {
		return this.userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}
	@Column(name="IS_DELE",length=1)
	public String getIsDele() {
		return this.isDele;
	}

	public void setIsDele(String isDele) {
		this.isDele = isDele;
	}
	@Column(name="VERSION",length=10)
	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}
	@Column(name="IS_NOT",length=1)
	public String getIsNot() {
		return isNot;
	}

	public void setIsNot(String isNot) {
		this.isNot = isNot;
	}

}